package com.markbuikema.juliana32.model.teams;

import java.text.DecimalFormat;
import java.util.GregorianCalendar;
import javax.crypto.spec.GCMParameterSpec;

import com.markbuikema.juliana32.util.DateTimeUtils;

public abstract class Event {
	private String id;
	private long date;

	public Event(String id, long date) {
		this.id = id;
		this.date = date;
	}

	public String getId() {
		return id;
	}

	public long getDate() {
		return date;
	}

	public String getDateString() {
		GregorianCalendar cal = new GregorianCalendar();
		cal.setTimeInMillis(date);
		return DateTimeUtils.getDutchDateString(cal);
	}
	
	public String[] getShortDateString() {
		GregorianCalendar cal = new GregorianCalendar();
		cal.setTimeInMillis(date);
		DecimalFormat df = new DecimalFormat("00");
		
		String[] result = new String[4];
		result[0] = DateTimeUtils.getDayOfWeekInDutch(cal.get(GregorianCalendar.DAY_OF_WEEK)).substring(0,2);
		result[1] = Integer.toString(cal.get(GregorianCalendar.DAY_OF_MONTH));
		result[2] = DateTimeUtils.getMonthInDutch(cal.get(GregorianCalendar.MONTH));
		result[3] = df.format(cal.get(GregorianCalendar.HOUR_OF_DAY)) + ":" + df.format(cal.get(GregorianCalendar.MINUTE));
		
		return result;
	}
}
